{{template "admin/base/base.html" .}}
{{template "admin/base/base_common.html" .}}
{{define "meta"}}<title>{{i18n .Lang "model.admin_topic"}} - {{i18n .Lang "app_name"}}</title>{{end}}
{{define "body"}}
<div class="row">
    <div id="content">
        <div class="col-md-2">
            {{template "admin/sidenav.html" .}}
        </div>
        <div class="col-md-10">
            {{if .Error}}
            <div class="alert alert-danger">
                {{.Error}}
            </div>
            {{end}}
            <div class="box">
                <div class="cell first breadcrumb">
                    <a href="{{.AppUrl}}admin"><i class="icon icon-home"></i></a><i class="divider icon-angle-right"></i><a href="{{.AppUrl}}admin/topic">{{i18n .Lang "model.admin_topic"}}</a>
                </div>
                <div class="cell last slim">
                    {{if .flash.DeleteSuccess}}
                    <div class="alert alert-info">
                        {{i18n .Lang "admin.success_delete"}}
                    </div>
                    {{end}}
                    {{if .flash.DeleteNotAllowed}}
                    <div class="alert alert-danger">
                        {{i18n .Lang "admin.delete_topic_not_allowed"}}
                    </div>
                    {{end}}
                    <p>
                        <a href="/admin/topic/new" class="btn btn-default">{{i18n .Lang "model.new_topic"}}</a>
                    </p>
                    <table class="table table-hover table-condensed color-link">
                        <thead>
                            <tr>
                                <th>Id</th>
                                <th>{{i18n .Lang "model.topic_name"}}</th>
                                <th>{{i18n .Lang "model.topic_slug"}}</th>
                                <th>{{i18n .Lang "model.topic_order"}}</th>
                                <th>{{i18n .Lang "model.created"}}</th>
                                <th>{{i18n .Lang "model.updated"}}</th>
                                <th>{{i18n .Lang "model.category"}}</th>
                        </thead>
                        <tbody>
                            {{range $topic := .Objects}}
                            <tr>
                                <td><a href="{{$.AppUrl}}admin/topic/{{$topic.Id}}">{{$topic.Id}}</a></td>
                                <td><a href="{{$.AppUrl}}admin/topic/{{$topic.Id}}">{{$topic.Name}}</a></td>
                                <td>{{$topic.Slug}}</td>
                                <td>{{$topic.Order}}</td>
                                <td>{{$topic.Created|datetime}}</td>
                                <td>{{$topic.Updated|datetime}}</td>
                                <td>{{$topic.Category.Name}}</td>
                            </tr>
                            {{end}}
                        </tbody>
                    </table>
                    {{template "base/paginator.html" .}}
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
    </div>
</div>
{{end}}